package com.ithema.mArrayList;

import java.util.Scanner;

public class VF {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        boolean flag=true;
        String s;
        char[]chars;
        lo:while (true){
            System.out.println("请输入字符串：");
             s = sc.nextLine();
            chars = s.toCharArray();
            for (int i = 0; i < chars.length; i++) {
                if(chars[i]>='A'&&chars[i]<='Z'){
                        break lo;
                }else {

                    flag=false;
                }
            }
            if(flag==false){
                System.out.println("您输入的字符串中没有大写字母。请重新输入!!");
            }
        }
        int samllConut=0;
        int bigConut=0;
        int numConut=0;
        int otherConut=0;
        for (int i = 0; i < chars.length; i++) {
            if(chars[i]>='a'&&chars[i]<='z'){
                samllConut++;
            }else if(chars[i]>='A'&&chars[i]<='Z'){
                bigConut++;
            }else if(chars[i]>='0'&&chars[i]<='9'){
                numConut++;
            }else {
                otherConut++;
            }
        }
        System.out.println("大写字母有："+bigConut);
        System.out.println("小写字母有："+samllConut);
        System.out.println("数字有："+numConut);
        System.out.println("其他字符有："+otherConut);
    }
}
